<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>l8w8jwt: include/l8w8jwt/retcodes.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">l8w8jwt
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_4cc40c4817b6dd8b994fc53e2126ebc6.html">l8w8jwt</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle"><div class="title">retcodes.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Macros for possible integer codes returned by the various l8w8jwt functions.  
<a href="#details">More...</a></p>
<div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="retcodes_8h__dep__incl.png" border="0" usemap="#ainclude_2l8w8jwt_2retcodes_8hdep" alt=""/></div>
<map name="ainclude_2l8w8jwt_2retcodes_8hdep" id="ainclude_2l8w8jwt_2retcodes_8hdep">
<area shape="rect" title="Macros for possible integer codes returned by the various l8w8jwt functions." alt="" coords="96,5,269,32"/>
<area shape="rect" href="decode_8h.html" title="Core DECODE function for l8w8jwt. Use this to decode and validate a JWT!" alt="" coords="5,80,171,107"/>
<area shape="poly" title=" " alt="" coords="156,44,106,82,103,77,152,40"/>
<area shape="rect" href="encode_8h.html" title="Core ENCODE function for l8w8jwt. Use this to encode a JWT header + payload WITHOUT signing." alt="" coords="195,80,360,107"/>
<area shape="poly" title=" " alt="" coords="213,40,263,77,259,82,210,44"/>
</map>
</div>
</div>
<p><a href="retcodes_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a713b64e22abe6cf763daa7f311d2f2e2" id="r_a713b64e22abe6cf763daa7f311d2f2e2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a713b64e22abe6cf763daa7f311d2f2e2">L8W8JWT_SUCCESS</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a713b64e22abe6cf763daa7f311d2f2e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1162d725d5b5a02ecd59b3b2c0151d9" id="r_af1162d725d5b5a02ecd59b3b2c0151d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af1162d725d5b5a02ecd59b3b2c0151d9">L8W8JWT_NULL_ARG</a>&#160;&#160;&#160;100</td></tr>
<tr class="separator:af1162d725d5b5a02ecd59b3b2c0151d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b7d18136ca13636d75d3b26fa9c9556" id="r_a6b7d18136ca13636d75d3b26fa9c9556"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6b7d18136ca13636d75d3b26fa9c9556">L8W8JWT_INVALID_ARG</a>&#160;&#160;&#160;200</td></tr>
<tr class="separator:a6b7d18136ca13636d75d3b26fa9c9556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdac86a7c21b7e45279c5d4059ff1ef2" id="r_acdac86a7c21b7e45279c5d4059ff1ef2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acdac86a7c21b7e45279c5d4059ff1ef2">L8W8JWT_OUT_OF_MEM</a>&#160;&#160;&#160;300</td></tr>
<tr class="separator:acdac86a7c21b7e45279c5d4059ff1ef2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a861ddf14da3ae24f8c15f83f80d6adac" id="r_a861ddf14da3ae24f8c15f83f80d6adac"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a861ddf14da3ae24f8c15f83f80d6adac">L8W8JWT_OVERFLOW</a>&#160;&#160;&#160;310</td></tr>
<tr class="separator:a861ddf14da3ae24f8c15f83f80d6adac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5bd30e0ae7e91c7adaf11c041aa4c01" id="r_aa5bd30e0ae7e91c7adaf11c041aa4c01"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa5bd30e0ae7e91c7adaf11c041aa4c01">L8W8JWT_SIGNATURE_CREATION_FAILURE</a>&#160;&#160;&#160;400</td></tr>
<tr class="separator:aa5bd30e0ae7e91c7adaf11c041aa4c01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae713fbf017e08bb3d599cd6f20d41803" id="r_ae713fbf017e08bb3d599cd6f20d41803"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae713fbf017e08bb3d599cd6f20d41803">L8W8JWT_SHA2_FAILURE</a>&#160;&#160;&#160;410</td></tr>
<tr class="separator:ae713fbf017e08bb3d599cd6f20d41803"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4385c6c96feba1e480025150e1b8930" id="r_ae4385c6c96feba1e480025150e1b8930"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae4385c6c96feba1e480025150e1b8930">L8W8JWT_KEY_PARSE_FAILURE</a>&#160;&#160;&#160;420</td></tr>
<tr class="separator:ae4385c6c96feba1e480025150e1b8930"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a514dd74c2bc135065b45a8f154f04435" id="r_a514dd74c2bc135065b45a8f154f04435"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a514dd74c2bc135065b45a8f154f04435">L8W8JWT_BASE64_FAILURE</a>&#160;&#160;&#160;425</td></tr>
<tr class="separator:a514dd74c2bc135065b45a8f154f04435"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01bb56d14e56d2562ef74137fbeada9a" id="r_a01bb56d14e56d2562ef74137fbeada9a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a01bb56d14e56d2562ef74137fbeada9a">L8W8JWT_WRONG_KEY_TYPE</a>&#160;&#160;&#160;450</td></tr>
<tr class="separator:a01bb56d14e56d2562ef74137fbeada9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd4421c1e00e6c7b2abaf2a856a85fb4" id="r_acd4421c1e00e6c7b2abaf2a856a85fb4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acd4421c1e00e6c7b2abaf2a856a85fb4">L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE</a>&#160;&#160;&#160;500</td></tr>
<tr class="separator:acd4421c1e00e6c7b2abaf2a856a85fb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab26241148ccad4d16f08c2ab409a8eeb" id="r_ab26241148ccad4d16f08c2ab409a8eeb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab26241148ccad4d16f08c2ab409a8eeb">L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT</a>&#160;&#160;&#160;600</td></tr>
<tr class="separator:ab26241148ccad4d16f08c2ab409a8eeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8af1ed938d5e7144a14986480da24a7" id="r_ad8af1ed938d5e7144a14986480da24a7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad8af1ed938d5e7144a14986480da24a7">L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE</a>&#160;&#160;&#160;700</td></tr>
<tr class="separator:ad8af1ed938d5e7144a14986480da24a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20fc1b7decb69be2c3576eef2b5a311d" id="r_a20fc1b7decb69be2c3576eef2b5a311d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a20fc1b7decb69be2c3576eef2b5a311d">L8W8JWT_UNSUPPORTED_ALG</a>&#160;&#160;&#160;800</td></tr>
<tr class="separator:a20fc1b7decb69be2c3576eef2b5a311d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Macros for possible integer codes returned by the various l8w8jwt functions. </p>
<dl class="section author"><dt>Author</dt><dd>Raphael Beck </dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a514dd74c2bc135065b45a8f154f04435" name="a514dd74c2bc135065b45a8f154f04435"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a514dd74c2bc135065b45a8f154f04435">&#9670;&#160;</a></span>L8W8JWT_BASE64_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_BASE64_FAILURE&#160;&#160;&#160;425</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Base64(URL) encoding or decoding error. </p>

</div>
</div>
<a id="ab26241148ccad4d16f08c2ab409a8eeb" name="ab26241148ccad4d16f08c2ab409a8eeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab26241148ccad4d16f08c2ab409a8eeb">&#9670;&#160;</a></span>L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT&#160;&#160;&#160;600</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if the token is invalid (format-wise). </p>

</div>
</div>
<a id="ad8af1ed938d5e7144a14986480da24a7" name="ad8af1ed938d5e7144a14986480da24a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8af1ed938d5e7144a14986480da24a7">&#9670;&#160;</a></span>L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE&#160;&#160;&#160;700</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if the token is invalid because it's missing the signature (despite having specified an alg that isn't "none"). </p>

</div>
</div>
<a id="a6b7d18136ca13636d75d3b26fa9c9556" name="a6b7d18136ca13636d75d3b26fa9c9556"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b7d18136ca13636d75d3b26fa9c9556">&#9670;&#160;</a></span>L8W8JWT_INVALID_ARG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_INVALID_ARG&#160;&#160;&#160;200</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This error code is returned by a l8w8jwt function if you passed an invalid parameter into it. </p>

</div>
</div>
<a id="ae4385c6c96feba1e480025150e1b8930" name="ae4385c6c96feba1e480025150e1b8930"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4385c6c96feba1e480025150e1b8930">&#9670;&#160;</a></span>L8W8JWT_KEY_PARSE_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_KEY_PARSE_FAILURE&#160;&#160;&#160;420</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if some PEM-formatted key string couldn't be parsed. </p>

</div>
</div>
<a id="acd4421c1e00e6c7b2abaf2a856a85fb4" name="acd4421c1e00e6c7b2abaf2a856a85fb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd4421c1e00e6c7b2abaf2a856a85fb4">&#9670;&#160;</a></span>L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE&#160;&#160;&#160;500</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>When the <code>mbedtls_ctr_drbg_seed()</code> function fails... </p>

</div>
</div>
<a id="af1162d725d5b5a02ecd59b3b2c0151d9" name="af1162d725d5b5a02ecd59b3b2c0151d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af1162d725d5b5a02ecd59b3b2c0151d9">&#9670;&#160;</a></span>L8W8JWT_NULL_ARG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_NULL_ARG&#160;&#160;&#160;100</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Error code returned by a l8w8jwt function if you passed a NULL argument that shouldn't have been NULL. </p>

</div>
</div>
<a id="acdac86a7c21b7e45279c5d4059ff1ef2" name="acdac86a7c21b7e45279c5d4059ff1ef2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acdac86a7c21b7e45279c5d4059ff1ef2">&#9670;&#160;</a></span>L8W8JWT_OUT_OF_MEM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_OUT_OF_MEM&#160;&#160;&#160;300</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is returned if some allocation inside a l8w8jwt function failed: you're out of memory at this point. </p>

</div>
</div>
<a id="a861ddf14da3ae24f8c15f83f80d6adac" name="a861ddf14da3ae24f8c15f83f80d6adac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a861ddf14da3ae24f8c15f83f80d6adac">&#9670;&#160;</a></span>L8W8JWT_OVERFLOW</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_OVERFLOW&#160;&#160;&#160;310</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Not good... </p>

</div>
</div>
<a id="ae713fbf017e08bb3d599cd6f20d41803" name="ae713fbf017e08bb3d599cd6f20d41803"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae713fbf017e08bb3d599cd6f20d41803">&#9670;&#160;</a></span>L8W8JWT_SHA2_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_SHA2_FAILURE&#160;&#160;&#160;410</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If one of the SHA-2 functions fails (e.g. SHA-256). </p>

</div>
</div>
<a id="aa5bd30e0ae7e91c7adaf11c041aa4c01" name="aa5bd30e0ae7e91c7adaf11c041aa4c01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5bd30e0ae7e91c7adaf11c041aa4c01">&#9670;&#160;</a></span>L8W8JWT_SIGNATURE_CREATION_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_SIGNATURE_CREATION_FAILURE&#160;&#160;&#160;400</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if signing a JWT failed. </p>

</div>
</div>
<a id="a713b64e22abe6cf763daa7f311d2f2e2" name="a713b64e22abe6cf763daa7f311d2f2e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a713b64e22abe6cf763daa7f311d2f2e2">&#9670;&#160;</a></span>L8W8JWT_SUCCESS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_SUCCESS&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned from a l8w8jwt function when everything went smooth 'n' chill. Time to get Schwifty, Morteyy! </p>

</div>
</div>
<a id="a20fc1b7decb69be2c3576eef2b5a311d" name="a20fc1b7decb69be2c3576eef2b5a311d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20fc1b7decb69be2c3576eef2b5a311d">&#9670;&#160;</a></span>L8W8JWT_UNSUPPORTED_ALG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_UNSUPPORTED_ALG&#160;&#160;&#160;800</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if the JWT signing alg parameter that was passed is not supported (e.g. the used l8w8jwt library was built without support for that algo, e.g. Ed25519). See the README.md for more details! </p>

</div>
</div>
<a id="a01bb56d14e56d2562ef74137fbeada9a" name="a01bb56d14e56d2562ef74137fbeada9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01bb56d14e56d2562ef74137fbeada9a">&#9670;&#160;</a></span>L8W8JWT_WRONG_KEY_TYPE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define L8W8JWT_WRONG_KEY_TYPE&#160;&#160;&#160;450</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returned if you passed the wrong private or public key type (e.g. trying to use an RSA key for ECDSA tokens, etc...). </p>
<p>Especially for the ECDSA algorithms like ES256, ES384 and ES512 double-check that you passed keys of the correct curve! </p>
<p>Only use the P-256 curve for ES256, P-384 (a.k.a. secp384r1) for ES384 and P-521 (a.k.a. secp521r1) for ES512. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
